package com.woniuxy02;

public class Test02 {

    public static void main(String[] args) {
//        Animal animal=new Animal();
        Dog dog = new Dog("dog1",1,80);
        Cat cat = new Cat("cat1",2,90);
        Feeder feeder = new Feeder();
        feeder.play(cat);
        feeder.play(dog);
        //运行时：后期联编
//        animal=dog;
        //编译时：先期联编
//        animal.catch
        // 对象  instanceof 类
//        System.out.println(animal instanceof Animal );
//        System.out.println(dog instanceof Animal );
//        System.out.println(cat instanceof Animal );
//        System.out.println(animal instanceof Dog );
//        System.out.println(dog instanceof Dog );
//        System.out.println(cat instanceof Dog );
    }
}
